package com.zjs.config;

import io.jsonwebtoken.SignatureException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * Created with IntelliJ IDEA.
 *
 * @author : zjs
 * @Date: 2020/9/2 21:02
 * Description:统一异常处理类
 */

@RestControllerAdvice
public class PermissionHandler {
    @ExceptionHandler(value = { SignatureException.class })
    @ResponseBody
    public Result<?> authorizationException(SignatureException e){
        return Result.error(new Exception().getMessage());
    }
}
